{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Data Types [demonstration]\n",
    "Explore how **strings**, **numbers**, and **booleans** are defined in Python.\n",
    "\n",
    "Read through the code and try to predict what each cell's output will look like *before* you run that cell."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "STRINGS\n",
      "Now run the cell below to see these strings printed!\n"
     ]
    }
   ],
   "source": [
    "# STRINGS\n",
    "#\n",
    "# In this section you define several variables. These are all defined\n",
    "# to be strings. Note that there are several ways to define a string.\n",
    "# \n",
    "print(\"STRINGS\")\n",
    "my_string_1 = \"hello\"\n",
    "my_string_2 = 'world'\n",
    "my_multiline_string = \"\"\"\n",
    "\n",
    "Dear World,\n",
    "\n",
    "Hello. I am a multiline python string.\n",
    "I'm enclosed in triple quotes. I'd write\n",
    "them here, but that would end the string!\n",
    "\n",
    "I know! I'll use a slash as an escape character.\n",
    "\n",
    "Triple quotes look like this: \\\"\\\"\\\" \n",
    "\n",
    "Sincerely,\n",
    "Python\n",
    "\"\"\"\n",
    "\n",
    "newline_character = \"\\n\"\n",
    "print(\"Now run the cell below to see these strings printed!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n",
      "\n",
      "\n",
      "Dear World,\n",
      "\n",
      "Hello. I am a multiline python string.\n",
      "I'm enclosed in triple quotes. I'd write\n",
      "them here, but that would end the string!\n",
      "\n",
      "I know! I'll use a slash as an escape character.\n",
      "\n",
      "Triple quotes look like this: \"\"\" \n",
      "\n",
      "Sincerely,\n",
      "Python\n",
      "\n",
      "\n",
      "\n",
      "-----------\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(my_string_1, my_string_2)\n",
    "print(my_multiline_string)\n",
    "print(newline_character)\n",
    "print(\"-----------\")\n",
    "print(newline_character)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NUMBERS\n"
     ]
    }
   ],
   "source": [
    "# NUMBERS AND BOOLEANS\n",
    "print(\"NUMBERS\")\n",
    "my_float    = 0.5\n",
    "my_integer  = 7\n",
    "my_negative = -3.5 \n",
    "my_fraction = 1/2\n",
    "\n",
    "# what do you think THIS line of code will assign to the variable\n",
    "# does_half_equal_point_five?\n",
    "does_half_equal_point_five = (my_fraction == my_float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The absolute value of -3.5 is 3.5\n",
      "7 squared is equal to 49\n",
      "Does 0.5 equal 0.5 ? True\n"
     ]
    }
   ],
   "source": [
    "print(\"The absolute value of\", my_negative, \"is\", abs(my_negative))\n",
    "print(my_integer, \"squared is equal to\", my_integer ** 2)\n",
    "print(\"Does\", my_fraction, \"equal\", my_float, \"?\", does_half_equal_point_five)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
